/**
 * @copyright: mengke
 */
#ifndef _GNU_TIMER_HXX__
#define _GNU_TIMER_HXX__
#include <sys/time.h>

static inline double wtime(){
	double time[2];	
	struct timeval time1;
	gettimeofday(&time1, NULL);

	time[0]=time1.tv_sec;
	time[1]=time1.tv_usec;

	return time[0]+time[1]*1.0e-6;
}

static inline double mwtime(){
  return 1000*wtime();
}

#endif